<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
    <title>首页 - 垃圾分类后台信息管理</title>
    <link rel="icon" href="pages/images/favicon.ico" type="image/ico">
    <meta name="keywords" content="LightYear,光年,后台模板,后台管理系统,光年HTML模板">
    <meta name="description" content="LightYear是一个基于Bootstrap v3.3.7的后台管理系统的HTML模板。">
    <meta name="author" content="yinqi">
    <link href="pages/css/bootstrap.min.css" rel="stylesheet">
    <link href="pages/css/materialdesignicons.min.css" rel="stylesheet">
    <link href="pages/css/style.min.css" rel="stylesheet">

    <style type="text/css">
        #container{
            height: 700px;
        }
    </style>
    <!--引入Javascript API GL，参数说明参见下文-->
    <script src="https://map.qq.com/api/gljs?v=1.exp&key=VSABZ-4KEWR-BUQWK-WOPU6-NUJFH-V2B37"></script>
    <script>
        //地图初始化函数，本例取名为init，开发者可根据实际情况定义
        // function initMap() {
        //     //定义地图中心点坐标
        //     var center = new TMap.LatLng(34.810894,113.509261)
        //     //定义map变量，调用 TMap.Map() 构造函数创建地图
        //     var map = new TMap.Map(document.getElementById('container'), {
        //         center: center,//设置地图中心点坐标
        //         zoom: 17.2,   //设置地图缩放级别
        //         pitch: 0,  //设置俯仰角
        //         rotation: 0    //设置地图旋转角度
        //     });
        //     //初始化marker图层
        //     var markerLayer = new TMap.MultiMarker({
        //         id: 'marker-layer',
        //         map: map
        //     });
        //
        //     //监听点击事件添加marker
        //     map.on("click", function(evt){
        //         markerLayer.add({
        //             position: evt.latLng
        //         });
        //     });
        // }
        /*--------------------------------------------------------------------------------------*/
        function initMap() {
            var center = new TMap.LatLng(34.814033, 113.508751);//设置中心点坐标
            //初始化地图
            var map = new TMap.Map("container", {
                center: center,
                zoom: 17.2
            });
            //初始marker
            var marker = new TMap.MultiMarker({
                id: 'marker-layer',
                map: map,
                styles: {
                    "marker": new TMap.MarkerStyle({
                        "width": 24,
                        "height": 35,
                        "anchor": { x: 12, y: 35 },
                        "src": 'https://mapapi.qq.com/web/lbs/javascriptGL/demo/img/markerDefault.png'
                    })
                },
                geometries: [{
                    "id": 'demo1',
                    "styleId": 'marker',
                    "position": new TMap.LatLng(34.814033, 113.508751),
                    "properties": {
                        "title": "marker"
                    }
                }, {
                    "id": 'demo2',
                    "styleId": 'marker',
                    "position": new TMap.LatLng(34.5814051, 113.509680),
                    "properties": {
                        "title": "marker"
                    },

                }]
            });
            //初始化infoWindow  信息窗口
            var infoWindow = new TMap.InfoWindow({
                map: map,
                position: new TMap.LatLng(34.5814051, 113.509680),
                offset: { x: 0, y: -32 } //设置信息窗相对position偏移像素

            });
            infoWindow.close();//初始关闭信息窗关闭
            //监听标注点击事件
            marker.on("click", function (evt) {
                //设置infoWindow
                infoWindow.open(); //打开信息窗
                infoWindow.setPosition(evt.geometry.position);//设置信息窗位置
                infoWindow.setContent(
                    "<div>\n" +
                    "    <h4 style=\"color: grey;\"><span class='mdi mdi-delete' ></span>1号垃圾桶</h4>\n" +
                    "</div>" +
                    "<div>\n" +
                    "    <table table class=\"table table-striped\">\n" +
                    "        <tr>\n" +
                    "            <td>垃圾种类</td>\n" +
                    "            <td>垃圾数量</td>\n" +
                    "        </tr>\n" +
                    "        <tr>\n" +
                    "            <td>可回收垃圾</td>\n" +
                    "            <td>11</td>\n" +
                    "        </tr>\n" +
                    "        <tr>\n" +
                    "            <td>有害垃圾</td>\n" +
                    "            <td>25</td>\n" +
                    "        </tr>\n" +
                    "        <tr>\n" +
                    "            <td>厨余垃圾</td>\n" +
                    "            <td>16</td>\n" +
                    "        </tr>\n" +
                    "        <tr>\n" +
                    "            <td>其他垃圾</td>\n" +
                    "            <td>22</td>\n" +
                    "        </tr>\n" +
                    "    </table>\n" +
                    "</div>" +
                    "<div>" +
                    "   <a href='pages/binManage/allBins.html'><span class='mdi mdi-file-find'></span>查看详情</a> " +
                    "</div>"


                );//设置信息窗内容
            })
        }


    </script>
</head>

<body onload="initMap()">
<div class="lyear-layout-web">
    <div class="lyear-layout-container">
        <!--左侧导航-->
        <aside class="lyear-layout-sidebar">

            <!-- logo -->
            <div id="logo" class="sidebar-header">
                <a href="index.html"><img src="pages/images/logo-sidebar.png" title="LightYear" alt="LightYear" /></a>
            </div>
            <div class="lyear-layout-sidebar-scroll">

                <nav class="sidebar-main">
                    <ul class="nav nav-drawer">
                        <li class="nav-item active"> <a href="index.html"><i class="mdi mdi-home"></i> 后台首页</a> </li>
                        <li class="nav-item nav-item-has-subnav">
                            <a href="javascript:void(0)"><i class="mdi mdi-palette"></i>垃圾桶</a>
                            <ul class="nav nav-subnav">
                                <li> <a href="pages/binManage/allBins.html">所有垃圾桶</a> </li>
                                <li> <a href="pages/binManage/garbageCounts.html">垃圾数量查看</a> </li>
                            </ul>
                        </li>
                        <li class="nav-item nav-item-has-subnav">
                            <a href="javascript:void(0)"><i class="mdi mdi-format-align-justify"></i> 数据展示</a>
                            <ul class="nav nav-subnav">
                                <li> <a href="pages/dataDisplay/trashData.html">垃圾桶</a> </li>
                                <li> <a href="pages/dataDisplay/garbageOfAll.html">垃圾总数</a> </li>
                                <li> <a href="pages/dataDisplay/packageGarbageNumber.html">打包数</a> </li>
                                <li> <a href="pages/dataDisplay/dataAnalysis.html">数据分析</a> </li>
                            </ul>
                        </li>
                        <li class="nav-item nav-item-has-subnav">
                            <a href="javascript:void(0)"><i class="mdi mdi-file-outline"></i> 记录查看</a>
                            <ul class="nav nav-subnav">
                                <li><a href="pages/logs/logs.html">日志信息</a></li>
                                <li><a href="pages/logs/warning.html">预警记录</a></li>
                            </ul>
                        </li>
                    </ul>
                </nav>

                <div class="sidebar-footer">
                    <p class="copyright">Copyright &copy; 2021. <a target="_blank" href="https://gitee.com/abinabin2dd/garbage-sorting">垃圾分类后台管理系统</a> All rights reserved.</p>
                </div>
            </div>

        </aside>
        <!--End 左侧导航-->

        <!--头部信息-->
        <header class="lyear-layout-header">

            <nav class="navbar navbar-default">
                <div class="topbar">

                    <div class="topbar-left">
                        <div class="lyear-aside-toggler">
                            <span class="lyear-toggler-bar"></span>
                            <span class="lyear-toggler-bar"></span>
                            <span class="lyear-toggler-bar"></span>
                        </div>
                        <span class="navbar-page-title"> 后台首页 </span>
                    </div>

                    <ul class="topbar-right">
                        <li class="dropdown dropdown-profile">
                            <a href="javascript:void(0)" data-toggle="dropdown">
                                <img class="img-avatar img-avatar-48 m-r-10" src="pages/images/users/avatar.jpg" alt="笔下光年" />
                                <span>管理员 <span class="caret"></span></span>
                            </a>
                            <ul class="dropdown-menu dropdown-menu-right">
                                <li> <a href="lyear_pages_profile.html"><i class="mdi mdi-account"></i> 个人信息</a> </li>
                                <li> <a href="lyear_pages_edit_pwd.html"><i class="mdi mdi-lock-outline"></i> 修改密码</a> </li>
                                <li> <a href="javascript:void(0)"><i class="mdi mdi-delete"></i> 清空缓存</a></li>
                                <li class="divider"></li>
                                <li> <a href="lyear_pages_login.html"><i class="mdi mdi-logout-variant"></i> 退出登录</a> </li>
                            </ul>
                        </li>
                        <!--切换主题配色-->
                        <li class="dropdown dropdown-skin">
                            <span data-toggle="dropdown" class="icon-palette"><i class="mdi mdi-palette"></i></span>
                            <ul class="dropdown-menu dropdown-menu-right" data-stopPropagation="true">
                                <li class="drop-title"><p>主题</p></li>
                                <li class="drop-skin-li clearfix">
                  <span class="inverse">
                    <input type="radio" name="site_theme" value="default" id="site_theme_1" checked>
                    <label for="site_theme_1"></label>
                  </span>
                                    <span>
                    <input type="radio" name="site_theme" value="dark" id="site_theme_2">
                    <label for="site_theme_2"></label>
                  </span>
                                    <span>
                    <input type="radio" name="site_theme" value="translucent" id="site_theme_3">
                    <label for="site_theme_3"></label>
                  </span>
                                </li>
                                <li class="drop-title"><p>LOGO</p></li>
                                <li class="drop-skin-li clearfix">
                  <span class="inverse">
                    <input type="radio" name="logo_bg" value="default" id="logo_bg_1" checked>
                    <label for="logo_bg_1"></label>
                  </span>
                                    <span>
                    <input type="radio" name="logo_bg" value="color_2" id="logo_bg_2">
                    <label for="logo_bg_2"></label>
                  </span>
                                    <span>
                    <input type="radio" name="logo_bg" value="color_3" id="logo_bg_3">
                    <label for="logo_bg_3"></label>
                  </span>
                                    <span>
                    <input type="radio" name="logo_bg" value="color_4" id="logo_bg_4">
                    <label for="logo_bg_4"></label>
                  </span>
                                    <span>
                    <input type="radio" name="logo_bg" value="color_5" id="logo_bg_5">
                    <label for="logo_bg_5"></label>
                  </span>
                                    <span>
                    <input type="radio" name="logo_bg" value="color_6" id="logo_bg_6">
                    <label for="logo_bg_6"></label>
                  </span>
                                    <span>
                    <input type="radio" name="logo_bg" value="color_7" id="logo_bg_7">
                    <label for="logo_bg_7"></label>
                  </span>
                                    <span>
                    <input type="radio" name="logo_bg" value="color_8" id="logo_bg_8">
                    <label for="logo_bg_8"></label>
                  </span>
                                </li>
                                <li class="drop-title"><p>头部</p></li>
                                <li class="drop-skin-li clearfix">
                  <span class="inverse">
                    <input type="radio" name="header_bg" value="default" id="header_bg_1" checked>
                    <label for="header_bg_1"></label>
                  </span>
                                    <span>
                    <input type="radio" name="header_bg" value="color_2" id="header_bg_2">
                    <label for="header_bg_2"></label>
                  </span>
                                    <span>
                    <input type="radio" name="header_bg" value="color_3" id="header_bg_3">
                    <label for="header_bg_3"></label>
                  </span>
                                    <span>
                    <input type="radio" name="header_bg" value="color_4" id="header_bg_4">
                    <label for="header_bg_4"></label>
                  </span>
                                    <span>
                    <input type="radio" name="header_bg" value="color_5" id="header_bg_5">
                    <label for="header_bg_5"></label>
                  </span>
                                    <span>
                    <input type="radio" name="header_bg" value="color_6" id="header_bg_6">
                    <label for="header_bg_6"></label>
                  </span>
                                    <span>
                    <input type="radio" name="header_bg" value="color_7" id="header_bg_7">
                    <label for="header_bg_7"></label>
                  </span>
                                    <span>
                    <input type="radio" name="header_bg" value="color_8" id="header_bg_8">
                    <label for="header_bg_8"></label>
                  </span>
                                </li>
                                <li class="drop-title"><p>侧边栏</p></li>
                                <li class="drop-skin-li clearfix">
                  <span class="inverse">
                    <input type="radio" name="sidebar_bg" value="default" id="sidebar_bg_1" checked>
                    <label for="sidebar_bg_1"></label>
                  </span>
                                    <span>
                    <input type="radio" name="sidebar_bg" value="color_2" id="sidebar_bg_2">
                    <label for="sidebar_bg_2"></label>
                  </span>
                                    <span>
                    <input type="radio" name="sidebar_bg" value="color_3" id="sidebar_bg_3">
                    <label for="sidebar_bg_3"></label>
                  </span>
                                    <span>
                    <input type="radio" name="sidebar_bg" value="color_4" id="sidebar_bg_4">
                    <label for="sidebar_bg_4"></label>
                  </span>
                                    <span>
                    <input type="radio" name="sidebar_bg" value="color_5" id="sidebar_bg_5">
                    <label for="sidebar_bg_5"></label>
                  </span>
                                    <span>
                    <input type="radio" name="sidebar_bg" value="color_6" id="sidebar_bg_6">
                    <label for="sidebar_bg_6"></label>
                  </span>
                                    <span>
                    <input type="radio" name="sidebar_bg" value="color_7" id="sidebar_bg_7">
                    <label for="sidebar_bg_7"></label>
                  </span>
                                    <span>
                    <input type="radio" name="sidebar_bg" value="color_8" id="sidebar_bg_8">
                    <label for="sidebar_bg_8"></label>
                  </span>
                                </li>
                            </ul>
                        </li>
                        <!--切换主题配色-->
                    </ul>

                </div>
            </nav>

        </header>
        <!--End 头部信息-->

        <!--页面主要内容-->
        <main class="lyear-layout-content">

            <div class="container-fluid">

                <div class="row">
                    <div class="col-sm-6 col-lg-3">
                        <div class="card bg-primary">
                            <div class="card-body clearfix">
                                <div class="pull-right">
                                    <p class="h6 text-white m-t-0">今日打包数</p>
                                    <p class="h3 text-white m-b-0 fa-1-5x">306</p>
                                </div>
                                <div class="pull-left"> <span class="img-avatar img-avatar-48 bg-translucent"><i class="mdi mdi-cup fa-1-5x"></i></span> </div>
                            </div>
                        </div>
                    </div>

                    <div class="col-sm-6 col-lg-3">
                        <div class="card bg-success">
                            <div class="card-body clearfix">
                                <div class="pull-right">
                                    <p class="h6 text-white m-t-0">总垃圾桶数</p>
                                    <p class="h3 text-white m-b-0 fa-1-5x">123</p>
                                </div>
                                <div class="pull-left"> <span class="img-avatar img-avatar-48 bg-translucent"><i class="mdi mdi-cup fa-1-5x"></i></span> </div>
                            </div>
                        </div>
                    </div>

                    <div class="col-sm-6 col-lg-3">
                        <div class="card bg-danger">
                            <div class="card-body clearfix">
                                <div class="pull-right">
                                    <p class="h6 text-white m-t-0">垃圾桶满载数</p>
                                    <p class="h3 text-white m-b-0 fa-1-5x">2326</p>
                                </div>
                                <div class="pull-left"> <span class="img-avatar img-avatar-48 bg-translucent"><i class="mdi mdi-alert-circle fa-1-5x"></i></span> </div>
                            </div>
                        </div>
                    </div>



                    <div class="col-sm-6 col-lg-3">
                        <div class="card bg-purple">
                            <div class="card-body clearfix">
                                <div class="pull-right">
                                    <p class="h6 text-white m-t-0">总垃圾投放数</p>
                                    <p class="h3 text-white m-b-0 fa-1-5x">2326</p>
                                </div>
                                <div class="pull-left"> <span class="img-avatar img-avatar-48 bg-translucent"><i class="mdi mdi-cup fa-1-5x"></i></span> </div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="row">

                    <div class="col-lg-12">
                        <div class="card">
                            <div class="card-header">
                                <h4>垃圾桶分布</h4>
                            </div>
                            <div class="card-body">
                                <!-- 定义地图显示容器 -->
                                <div id="container"></div>
                            </div>
                        </div>

                    </div>


                </div>



            </div>

        </main>
        <!--End 页面主要内容-->
    </div>
</div>

<script type="text/javascript" src="pages/js/jquery.min.js"></script>
<script type="text/javascript" src="pages/js/bootstrap.min.js"></script>
<script type="text/javascript" src="pages/js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" src="pages/js/main.min.js"></script>
<script>
    $(document).ready(function (e) {
        // 使用时，请自行引入jquery.cookie.js
        // 读取cookie中的主题设置
        var the_logo_bg    = $.cookie('the_logo_bg'),
            the_header_bg  = $.cookie('the_header_bg'),
            the_sidebar_bg = $.cookie('the_sidebar_bg'), // iframe版本如果删除了下面一行，请把这一行的逗号改成分号
            the_site_theme = $.cookie('the_site_theme'); // iframe版本可不需要这行

        if (the_logo_bg) $('body').attr('data-logobg', the_logo_bg);
        if (the_header_bg) $('body').attr('data-headerbg', the_header_bg);
        if (the_sidebar_bg) $('body').attr('data-sidebarbg', the_sidebar_bg);
        if (the_site_theme) $('body').attr('data-theme', the_site_theme); // iframe版本可不需要这行

        // 处理主题配色下拉选中
        $(".dropdown-skin :radio").each(function(){
            var $this = $(this),
                radioName = $this.attr('name');
            switch (radioName) {
                case 'site_theme':
                    $this.val() == the_site_theme && $this.prop("checked", true);
                    break;  // iframe版中不需要这个case
                case 'logo_bg':
                    $this.val() == the_logo_bg && $this.prop("checked", true);
                    break;
                case 'header_bg':
                    $this.val() == the_header_bg && $this.prop("checked", true);
                    break;
                case 'sidebar_bg':
                    $this.val() == the_sidebar_bg && $this.prop("checked", true);
            }
        });

        // 设置主题配色
        setTheme = function(input_name, data_name) {
            $("input[name='"+input_name+"']").click(function(){
                $('body').attr(data_name, $(this).val());
                $.cookie('the_'+input_name, $(this).val());
            });
        }
        setTheme('site_theme', 'data-theme'); // iframe版本可不需要这行
        setTheme('logo_bg', 'data-logobg');
        setTheme('header_bg', 'data-headerbg');
        setTheme('sidebar_bg', 'data-sidebarbg');
    });
</script>
</body>
</html>